/*
 * @Author: moonwater 13812995013@163.com
 * @Date: 2025-03-05 14:18:23
 * @LastEditors: moonwater 13812995013@163.com
 * @LastEditTime: 2025-03-13 15:20:21
 * @FilePath: \盐师22Git仓库\day08\Truck.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day08;

import java.util.Scanner;

public class Truck extends Automobile{
    // 新增子类变量 卡车型号model
    // private String model;
    private int rent;

    public void setRent(int rent) {
        this.rent = rent;
    }
 
    public int getRent() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入卡车型号(小型卡车为1/中型卡车为2/大型卡车为3)");
        int model = scanner.nextInt();

        switch (model) {
            case 1:
                rent = 300;
                break;
            case 2:
                rent = 350;
                break;
            case 3:
                rent = 500;
                break;

            default:
                System.out.println("输入有误,请输入1，2，3");
                break;
        }
        System.out.println("每天租金为：" + rent + "元");

        scanner.close();
        return rent;
    }

}
